//
//  UILabel+hf.m
//  QiBaoTong
//
//  Created by 韩艳锋 on 2019/6/17.
//  Copyright © 2019 策驭. All rights reserved.
//

#import "UILabel+hf.h"
#import "UIColor+hf.h"

@implementation UILabel (hf)
+(instancetype)lableWithColorStr:(NSString*)hex fontSize:(CGFloat)heigh {
    return [self lableWithTextColor:[UIColor colrWithString:hex] font:[UIFont systemFontOfSize:heigh]];
}
+(instancetype)lableWithTextColor:(UIColor*)color
                            font:(UIFont*)font{
    UILabel * label = [[self alloc] init];
    label.font = font;
    label.textColor = color;
    return label;
}
+(instancetype)lableWithColorStr:(NSString*)hex
                         fontFamily:(NSString*)fontFamily
                           fontSize:(CGFloat)size {
    UIFont * font = [UIFont fontWithName:fontFamily size:size];
    if (font == nil) {
        NSLog(@"不能创建Family为%@", fontFamily);
        font = [UIFont systemFontOfSize:size];
    }
    return [self lableWithTextColor:[UIColor colrWithString:hex] font:font];
}
@end
